﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Data;

namespace Coding4Fun.MissionControl.WP.Converters
{
    public class TemplateSelector : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (value != null)
            {
                string stVal = value.ToString();
                if (stVal.ToLower() == "pad")
                    return (DataTemplate)App.Current.Resources["PadTemplate"];
                else
                    return (DataTemplate)App.Current.Resources["GenericCommandTemplate"];
            }
            else
            {
                return (DataTemplate)App.Current.Resources["GenericCommandTemplate"];
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
